package StudyGroup;

/*
* 强制类型转换
* 2022.1.8
* Creat By Code J
* */
public class Forcedtypeconversion {
    public static void main(String[] args){
        double d1 = 12.3;
        int i1 = (int)d1; //截断操作
        System.out.println(i1);//损失精度

        long l1 = 123;
        short s1 = (short) l1;
        System.out.println(s1);

        int i2 = 1;
        byte b1 = (byte) i2;
        System.out.println(b1);

        //编码情况
        long l2 = 123456423213L;
        System.out.println(l2);

        float f1 = 12.33f;
        System.out.println(f1);

    }

}
